﻿@{
    Layout = null;
    decimal CYear = ViewData["CYear"] == null ? 0 : decimal.Parse(ViewData["CYear"].ToString());
    decimal CMonth = ViewData["CMonth"] == null ? 0 : decimal.Parse(ViewData["CMonth"].ToString());
}
@model ElingOA6_Admin_DSJCJ.Model.MonthPlanSummary
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>鄞州区财政局::电子绩效台帐系统</title>
  @if (false)
  {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
  }
    <link href="@Url.Content("~/Content/style.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/rzcss.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Fckeditor/fckeditor.js", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script type="text/javascript">
        var jsCYear = '@CYear';
        var jsCMonth = '@CMonth';
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            var oFCKeditor = new FCKeditor('FContentP');
            oFCKeditor.BasePath = rootPath + "/fckeditor/";
            oFCKeditor.ToolbarSet = "Basic_Blank";
            oFCKeditor.ReplaceTextarea();

            var oFCKeditor = new FCKeditor('FContentS');
            oFCKeditor.BasePath = rootPath + "/fckeditor/";
            oFCKeditor.ToolbarSet = "Basic_Blank";
            oFCKeditor.ReplaceTextarea();

            var hdjsAlert = $("#hidMessage").val();
            var hdjsAlert2 = $("#hidIsClose").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
                if (hdjsAlert2 == "Y") {
                    window.returnValue = 'SUCCESS';
                    window.location.href = rootPath + "/Admin/MonthPlanSummary/MonthPlanSummaryAdd?year=" + $("#hidyear").val + "&month=" + $("#hidmonth").val() + "&emplNo=" + $("#hidemplNo").val;
                }
            }
            //页面判断是否有权限补录
            var allow = $("#hidAllow").val();
            if (allow == "true") {
                var myDate = new Date();
//                alert($("#hidyear").val());
//                alert(myDate.getYear());
//                alert($("#hidmonth").val());
//                alert(myDate.getMonth() + 1);
                if ($("#hidyear").val() > jsCYear || $("#hidmonth").val() < jsCMonth) {
                    alert("不能提前录入工作计划和总结");
                    window.location.href = rootPath + "/Admin/MonthPlanSummary";
                }
            } else {
                var myDate = new Date();
                if ($("#hidyear").val != jsCYear && $("#hidmonth").val() != jsCMonth) {
                    alert("不能提前补录工作计划和总结");
                    window.location.href = rootPath + "/Admin/MonthPlanSummary";
                }
            }

            //            var P = $("#hidP").val();
            //            var S = $("#hidS").val();
            //            if (P != "" && allow == "true") {
            //                $("#FContent_ReadOnly_P").css("display", "block");
            //                $("#FContent_P").css("display", "none");
            //                $("#upPlan_P").css("display", "none");
            //            } else {
            //                $("#FContent_ReadOnly_P").css("display", "none");
            //                $("#FContent_P").css("display", "block");
            //                $("#upPlan_P").css("display", "block");
            //            }

        });
        function isUpdateP(s, e) {               
            var oFCKeditor = FCKeditorAPI.GetInstance("FContentP");
            if (s.GetChecked() == true) {
                oFCKeditor.EditorDocument.body.contentEditable = true;           
            } else {
                oFCKeditor.EditorDocument.body.contentEditable = false;
            }
        }
        function isUpdateS(s, e) {
            var oFCKeditor = FCKeditorAPI.GetInstance("FContentS");
            if (s.GetChecked() == true) {
                oFCKeditor.EditorDocument.body.contentEditable = true;
            } else {
                oFCKeditor.EditorDocument.body.contentEditable = false;
            }
        }
        /*FCK只读*/
        function FCKeditor_OnComplete(editor) {
            var clientcheckbox = ASPxClientCheckBox.Cast("upPlan");
            if (clientcheckbox.GetChecked() == true) {
                editor.EditorDocument.body.contentEditable = true;
            } else {
                editor.EditorDocument.body.contentEditable = false;
            }           
        }
        /*FCK只读*/
        function FCKeditor_OnComplete(editor) {
            var clientcheckbox = ASPxClientCheckBox.Cast("upSummary");
            if (clientcheckbox.GetChecked() == true) {
                editor.EditorDocument.body.contentEditable = true;
            } else {
                editor.EditorDocument.body.contentEditable = false;
            }
        }    
    </script>
</head>
<body>
	<div class="container">
    	<div class="header">
        	<div class="header_top">
            	<div class="header_name">
            	<span class="h1">这里是<b>@ViewData["emplName"].ToString()</b>的工作计划和总结</span>
                <span>我的工作工作计划和总结的录入</span>
            	</div>
            	<div class="header_time">
                <span style="padding-top:20px;"><b>@ViewData["year"].ToString() </b>年 <b>@ViewData["month"].ToString()</b> 月</span>
@*                <span><a href="#" onclick="MonthChange('prev')">上月</a>
                      <a href="#" onclick="MonthChange('this')">本月</a>
                      <a href="#" onclick="MonthChange('next')">下月</a>
                </span>*@
                </div>
            </div>
            
            <div class="header_nav">
                	@*权限分配*@
                    @if (ViewData["strSecond"].ToString() == "Y")
                    {
                	<li><span><img src="@Url.Content("~/Content/images/nav04.png", true)"></span><a href="@Url.Action("NoMonthPlanSummaryList", "MonthPlanSummary")" target="_blank">工作计划未上报人员清单</a></li>
                    }
                    @if (ViewData["strFirst"].ToString() == "Y")
                    {
                    <li><span><img src="@Url.Content("~/Content/images/nav03.png", true)"></span><a href="@Url.Action("AcDeptTimesList", "MonthPlanSummary")" target="_blank">科室应扣实际次数</a></li>
                    }
                @*权限分配*@
                    <li><span><img src="@Url.Content("~/Content/images/nav02.gif", true)"></span>
                        <a href="@Url.Action("MonthPlanSummaryAdd", "MonthPlanSummary", new { emplNo = ViewData["emplNo"].ToString() })" target="_blank">计划总结录入</a></li>
                	<li><span><img src="@Url.Content("~/Content/images/nav01.gif", true)"></span><a href="/" target="_blank">返回局首页</a></li>
            </div>
        	 
        </div>
        
        <div class="main">
        	<div class="plan">
            @using (Html.BeginForm("SaveMonthPlanSummary", "MonthPlanSummary", FormMethod.Post, new { id = "form1" }))
            {
           	  <table width="960" border="1">
                  <tr>
                    <td width="22%" height="35" align="center" class="font14">时间/月份</td>
                    <td width="78%" class="font14">&nbsp;&nbsp;@ViewData["month"].ToString()月工作总结</td>
                  </tr>                 
                      <tr>
                        <td height="162" align="center" class="font14">                           
                            <span>
                            @Html.DevExpress().CheckBox(
                            settings =>
                            {
                                settings.Name = "upSummary";
                                settings.Checked = (bool)ViewData["upSummary"];
                                //settings.Checked = true;
                                settings.ControlStyle.CssClass = "button";
                                settings.Properties.ClientSideEvents.CheckedChanged = "function(s, e){ isUpdateS(s, e)}";
                            }).GetHtml()
                            </span> 更新 </td>
                        <td>
                            @Html.TextArea("FContentS", ViewData["FContentS"].ToString().Replace("\r\n", "<br />"), new { @cols = "100", @rows = "10" })
                        </td>                       
                     </tr>
                   <tr>
                    <td width="22%" height="35" align="center" class="font14">时间/月份</td>
                    <td width="78%" class="font14">&nbsp;&nbsp;@ViewData["nextmonth"].ToString()月工作计划</td>
                  </tr>
                  <tr>
                    <td height="162" align="center" class="font14">
                        <span>
                        @Html.DevExpress().CheckBox(
                        settings =>
                        {
                            settings.Name = "upPlan";
                            settings.Checked = (bool)ViewData["upPlan"];
                            //settings.Checked = true;
                            settings.ControlStyle.CssClass = "button";
                            settings.Properties.ClientSideEvents.CheckedChanged = "function(s, e){ isUpdateP(s, e)}";
                        }).GetHtml()
                        </span> 更新 </td>
                    <td>                       
                       @Html.TextArea("FContentP", ViewData["FContentP"].ToString().Replace("\r\n", "<br />"), new { @cols = "100", @rows = "10" })
                     </td>
                  </tr>
                  <tr>
                    <td height="35">&nbsp;</td>
                     <td> 
                        <input class="but" type="submit" name="button" id="button" value="确认更新"   />
                      </td>
                  </tr>
                </table>                          
                @Html.Hidden("hidyear", ViewData["year"])
                @Html.Hidden("hidmonth", ViewData["month"])
                @Html.Hidden("hidnextmonth", ViewData["nextmonth"])
                @Html.Hidden("hidemplNo", ViewData["emplNo"])
                @Html.Hidden("hidtypePlan", ViewData["typePlan"])
                @Html.Hidden("hidtypeSummary", ViewData["typeSummary"])
                @Html.Hidden("hidMessage", ViewData["message"])
                @Html.Hidden("hidIsClose", ViewData["IsClose"])
                @Html.Hidden("hidAllow", ViewData["allow"])
                @Html.Hidden("hidP", ViewData["FContentP"])
                @Html.Hidden("hidS", ViewData["FContentS"])
            }
            </div>
        </div>
    
    </div>
   
</body>
</html>






